// des_test.c
//

#include "stdio.h" 
#include "stdlib.h"   
#include "3des.h"

int main()   
{      
    // char *file_In = "in.txt";
    // char *file_Out = "out.txt";
    // char *file_tmp = "des.dat";
    // char *key = "key.txt"; 
	// int ln;
	
	// char data_In[8] = {0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a};
	char data_In[9] = "beijingi";
	char key[9] = "shahaiii";
    char data_Out[8] = {0};
//    char *data_tmp = "des.dat";
//    char key[8] = {0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02};
    // char key[16] = {0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,
					// 0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02}; 
//	int ln;

	DES_Encrypt(data_In, key, data_Out, 8);
	for(int i=0; i<8; i++)
	{
		printf("%02x ", data_In[i]);
	}
	printf("\r\n");
	for(int i=0; i<8; i++)
	{
		printf("%02x ", (unsigned char)data_Out[i]);
	}
    // //DES加密  
    // DES_Encrypt_File(file_In,key,file_tmp);   
    // printf("DES_E OK!\n");

    // //DES解密  
    // DES_Decrypt_File(file_tmp,key,file_Out);
    // if(remove(file_tmp)){}   
    // printf("DES_D OK!\n");

	// //3重DES加密
	// D3DES_Encrypt_File(file_In,key,file_tmp);   
	// printf("D3DES_E OK!\n");

	// //3重DES解密  
	// D3DES_Decrypt_File(file_tmp,key,file_Out);
	// if(remove(file_tmp)){}   
	// printf("D3DES_D OK!\n");
	
	// getchar();
    return 0;   
}   